package com.caldremch.androidfoundation.http;


import com.caldremch.androidfoundation.http.model.BaseRespData;
import com.caldremch.androidfoundation.http.model.CommonConfigResp;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Url;

/**
 * @author Caldremch
 * @date 2018-09-03 15:51
 * @describe  请求接口
 **/
public interface ApiService {


    @POST()
    Observable<ResponseBody> postBody(@Url() String url, @Body RequestBody requestBody);

    @FormUrlEncoded
    @POST()
    Observable<ResponseBody> post(@Url() String url, @FieldMap Map<String, String> maps);


    @FormUrlEncoded
    @POST()
    Observable<ResponseBody> postForm(@Url() String url, @FieldMap Map<String, Object> maps);


    @POST("Common/Config.json")
    Observable<BaseRespData<CommonConfigResp>> getCommConfig(@Body BaseReqData data);


    @POST("/user-api/v1/user/login")
    Observable<ResponseBody> login();


}
